import React from 'react'
import { Modal } from 'antd'
import { ExclamationCircleOutlined } from '@ant-design/icons'

interface ConfirmModalProps {
  title?: string
  content: React.ReactNode
  onConfirm: () => void | Promise<void>
  okText?: string
  cancelText?: string
}

const { confirm } = Modal

const ConfirmModal = ({
  title = '确认操作',
  content,
  onConfirm,
  okText = '确定',
  cancelText = '取消'
}: ConfirmModalProps) => {
  confirm({
    title,
    icon: <ExclamationCircleOutlined />,
    content,
    okText,
    cancelText,
    onOk: onConfirm
  })
}

export default ConfirmModal 